package com.AuthServer.mapper;

import com.AuthServer.pojo.entity.User;
import com.AuthServer.pojo.query.UserQuery;
import com.AuthServer.pojo.vo.UserPermVo;
import com.AuthServer.pojo.vo.UserVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface UserMapper extends BaseMapper<User> {
    User selectUserById(@Param("userId") String userId);

    @Select("SELECT teacher_name FROM teacher WHERE teacher_id = #{teacherId}")
    String getTeacherNameById(@Param("teacherId") String teacherId);

    void updateStatus(@Param("status")Integer status, @Param("userId")String userId);


    Page<UserPermVo> searchUserList(Page<UserPermVo> page, @Param("search") UserQuery search);
}
